<template>
  <div class="about">
    <el-table
            :data="tableData"
            style="width: 100%">
      <el-table-column
              v-for="i in tableData.length + 1"
              :prop="propArray[i-1]"
              :label="labelArray[i-1]"
              width="180">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

  export default {
    data() {
      return {
        propArray: [],
        labelArray: [
          '日期',
          '名称',
          '地址',
          '邮箱',
          '年龄',
        ],
        tableData: [{
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }]
      }
    },
    mounted() {
      Object.keys(this.tableData[0]).map((key) => {
        this.propArray.push(key)
      })
    }
  }
</script>